package com.example.clientbwic.service.login;

import com.example.clientbwic.entity.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 86150
 * @Date: 2024/4/13
 * @Description: com.example.clientbwic.service
 */
@Service
public class LoginServiceImpl implements LoginService{

    @Autowired
    RestTemplate restTemplate;
    @Override
    public Client getClient(Long clientId) {
        // 实现登录逻辑
        Client client = restTemplate.getForObject("http://localhost:8087/getClient/" + clientId, Client.class);
        if (client != null) {
            return client;
        } else {
            return null;
        }
    }

}
